<template>
  <a-table :columns="columns" :data-source="rows" :pagination="false" size="small" bordered>
  </a-table>
</template>
  <script lang="ts">
import { SmileOutlined, DownOutlined } from '@ant-design/icons-vue';
import { defineComponent, ref } from 'vue';
import { defHttp } from '/@/utils/http/axios';
const columns = [
  {
    title: '测点名称',
    dataIndex: 'no',
    key: 'no',
  },
  {
    title: '设备状态',
    dataIndex: 'status',
    key: 'status',
  },
  {
    title: '预警状态',
    dataIndex: 'warn',
    key: 'warn',
  },
  {
    title: '数据',
    key: 'data1',
    dataIndex: 'data1',
  },
];

export default defineComponent({
  components: {
    SmileOutlined,
    DownOutlined,
  },
  setup() {
    const rows = ref([]);

    function getTableData(params) {
      defHttp.get({ url: '/Sensor/get-by-project-id-and-sensor-type', params }).then((res) => {
        rows.value = res.data;
      });
    }

    return {
      columns,
      rows,
      getTableData,
    };
  },
});
</script>
  
  